# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(MSLiteTokenizer)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)
file(GLOB_RECURSE SOURCES
    src/*.cpp napi_init.cpp)
add_library(entry SHARED ${SOURCES})

target_link_libraries(entry PUBLIC libace_napi.z.so)
target_link_libraries(entry PUBLIC hilog_ndk.z)
include_directories(${NATIVERENDER_ROOT_PATH}/thirdparty)

target_link_libraries(entry PUBLIC ${NATIVERENDER_ROOT_PATH}/../../../libs/${OHOS_ARCH}/jsoncpp/libjsoncpp.so.25)
target_link_libraries(entry PUBLIC ${NATIVERENDER_ROOT_PATH}/../../../libs/${OHOS_ARCH}/sentencepiece/libsentencepiece.so.0)
target_link_libraries(entry PUBLIC ${NATIVERENDER_ROOT_PATH}/../../../libs/${OHOS_ARCH}/sentencepiece/libsentencepiece_train.so.0)